package io.datajek.springbasics.movierecommendersystem.lesson11;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;


@Component
//    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
public class Movie {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    private int id;
    private String name;
    private String genre;
    private String producer;
//    private static int instances = 0;
//
//    private int id;
//    private String name;
//    private String genre;
//    private String producer;

    public Movie() {
        super();
        logger.info("In Movie constructor method");
//        instances++;
//        System.out.println("Movie constructor called");
    }
    @PostConstruct
    private void postConstruct() {

        logger.info("In Movie postConstruct method");
    }
    @PreDestroy
    private void preDestroy() {

        logger.info("In Movie preDestroy method");
    }
//    public static int getInstances() {
//        return Movie.instances;
//    }
    public double movieSimilarity(int movie1, int movie2) {

        double similarity = 0.0;
        return similarity;
    }


}
